<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>问题列表</title>
		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css" />
		<style>
			*{
				padding: 0px;
				margin: 0px;
				border: 0px;
				font-family: "黑体";
			}
			
			#serachprotype{
				position: fixed;
				width: 100%;
				height: 40px;
				top: 10px;
				background-color: #fafafa;
			}
		</style>
	</head>

	<body style="background-color: white;">
		<div id="serachprotype" style="">
			<input type="search" placeholder="Search" style="height: 30px; background-color: white; font-size: 17px;"/>
		</div>
		<div class="mui-content" style="background-color: white;">
			<div id="rfcproblemtypelst" class="mui-scroll-wrapper" style="height: 92%; top: 60px;">
				<div class="mui-scroll">
					<div id="dv-pro-lst" style="width: 100%; ">
						<div id="prolst-tem" >
							
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/utils/http.utils.js"></script>
	<script>
		var $wxfwid = localStorage.getItem("wxfwid");
		var $pcode = fun_getUrlForParams(window.location.href, "procode");
		
		var $currpage = 0;
		mui.init({
			pullRefresh: {
				container: "#rfcproblemtypelst",
				up: {
					height: 20,
					auto: true,
					deceleration: 0.0006 ,
					contentrefresh : "加载中...",
					contentnomore:'没有更多数据了',
					callback: loadprobTypeLstDat
				}
			}
		});
		
		function loadprobTypeLstDat(){
			getProbTypeLstDat(8, $currpage);
		}
		
		function getProbTypeLstDat($psize, $cpage){
			mui.ajax({
				url : $request_url.getComProLst,
				type : "get",
				headers: {
					"Authorization": $headers_authorization
				},
				dataType : "json",
				data : {
					orgId : $wxfwid,
					typeCode : $pcode,
					rows : $psize,
					page : $cpage
				}, 
				success : function(dat){
					if(dat.code == 0){
						var $result = dat.result;
						if($result != null && $result != ""){
							$currpage ++;
							mui("#rfcproblemtypelst").pullRefresh().endPullupToRefresh(false);
							var $resDoc = document.getElementById("prolst-tem");
							for(var i = 0; i < $result.length; i ++){
								var $div = document.createElement("div");
								$div.style.marginTop = "8px";
								$div.innerHTML = fun_proLstTem($result[i], i);
								$resDoc.appendChild($div);
							}
						} else {
							mui("#rfcproblemtypelst").pullRefresh().endPullupToRefresh(true);
						}
					} else {
						mui.toast(dat.message);
						return;
					}
				}, error : function(err){
					mui.toast("服务繁忙...");
					return;
				}
			});
		}
		
		function fun_proLstTem($proInfo, $num){ 
			var $proTem = 
			  '<a style="display:block;" href="comProDetailed.html?proid='+ $proInfo.id +'">'
            //+   	'<div style="margin: 2px 5px 2px 5px; float: left;">'
            //+    		'<img src="'+ $proInfo.thumbnail +'" height="80" width="80" />'
            //+    	'</div>'
            +    	'<div style="margin: 2px 0px 2px 10px;">'
            +    		'<div style="color: #303030; font-size: 16px;">'+ $proInfo.title +'</div>'
            +    		'<div style="margin-top: 20px; color: #303030; font-size: 14px;">'
            +    			'<span style="float: left; display: block; "><img src="../../img/jzkt/yanjing_03.png" style="width:16px;" />&nbsp;'+ $proInfo.readCount +'</span>'
            +   			'<span style="float: right; display: block; margin-right:20px;"><img src="../../img/comm.png" style="width:16px;"/>&nbsp;'+ $proInfo.commentInfo.commentNum +'</span>'
            +    		'</div>'
            +    	'</div>'
            +    '</a><hr style="width: 100%; background-color: #DCDCDC; height: 1px; margin-top:45px;" />';
			return $proTem;
		}
		
		mui("#prolst-tem").on("tap", "a", function(){
			mui.openWindow({
				url : this.href
			});
		});
	</script>

</html>